#ifndef ENCODING_H
#define ENCODING_H
#include <stdint.h>

#define BASE16_BASE64_ENCODE_LEN(_len_) BASE16_ENCODE_LEN(BASE64_ENCODE_LEN(_len_))
#define BASE64_BASE16_DECODE_LEN(_len_) BASE64_DECODE_LEN(BASE16_DECODE_LEN(_len_))

/**
 * @brief This means base16_encode(base64_encode(bytes))
 * 
 * @author Tang (2018/11/29)
 * 
 * @param[in] psrc Pointer to source data 
 * @param[in] src_len length of source data
 * @param[out] pdst Ponter to destination data
 * @param[in] dst_len Length of destination data
 * 
 * @return uint32_t Data length after encoding
 *   
 */
uint32_t base16_base64_encode(uint8_t *psrc, uint32_t src_len, uint8_t *pdst, uint32_t dst_len);

/**
 * @brief This means base64_decode(base16_decode(bytes))
 * 
 * @author Tang (2018/12/3)
 * 
 * @param[in] psrc Pointer to source data 
 * @param[in] src_len length of source data
 * @param[out] pdst Ponter to destination data
 * @param[in] dst_len Length of destination data
 * 
 * @return uint32_t Data length after encoding
 */
uint32_t base64_base16_decode(uint8_t *psrc, uint32_t src_len, uint8_t *pdst, uint32_t dst_len);
#endif

